<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<%@include file="/include/head_libs.jsp" %>
<script type="text/javascript" src="<c:url value='/assets/js/admin/admin_user.js'/>"></script>
<body class="font-sans h-full bg-gray-100">
<%-- 用户表格 --%>
<div class="container mx-auto p-4 select-none overflow-auto">
    <div class="flex justify-between items-center mb-4">
        <h2 class="text-xl font-bold text-gray-700">用户管理</h2>
    </div>
    <div class="overflow-x-auto bg-white shadow-md rounded-lg">
        <table class="table w-full">
            <thead>
            <tr>
                <th>头像</th>
                <th>用户名</th>
                <th>角色</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="userTableBody"></tbody>
        </table>
    </div>
</div>

<%-- 模态框 --%>
<div id="userModal" class="modal modal-bottom sm:modal-middle">
    <div class="modal-box">
        <h2 class="text-xl font-semibold text-gray-700 mb-4" id="modalTitle">编辑用户</h2>
        <form id="userForm">
            <div class="mb-4">
                <label class="block text-sm font-medium text-gray-600">用户名</label>
                <input type="text" id="username" class="input input-bordered w-full" placeholder="请输入用户名"
                       readonly>
            </div>
            <div class="mb-4">
                <label for="password" class="block text-sm font-medium text-gray-600">密码</label>
                <input type="password" id="password" class="input input-bordered w-full" placeholder="请输入密码">
            </div>
            <div class="mb-4">
                <label for="avatarUrl" class="block text-sm font-medium text-gray-600">头像 URL</label>
                <input type="text" id="avatarUrl" class="input input-bordered w-full" placeholder="请输入头像 URL">
            </div>
            <div class="flex justify-end">
                <button type="button" class="btn btn-secondary mr-2" id="cancelSubmit">取消</button>
                <button type="submit" class="btn btn-primary">保存</button>
            </div>
        </form>
    </div>
</div>
</body>
</html>